package com.xbongbong.saas.model;

import com.xbongbong.paas.domain.entity.PaasFormSubDataEntity;
import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.saas.domain.entity.InvoiceExpressSubDataEntity;
import org.elasticsearch.action.support.WriteRequest;

import java.util.List;
import java.util.Map;

/**
 * @author: xingxing.xiao
 * @date: 2020/10/12 20:24
 */
public interface InvoiceExpressSubDataModel extends IModel<InvoiceExpressSubDataEntity> {

    @Override
    Integer insert(InvoiceExpressSubDataEntity entity) throws XbbException;

    @Override
    Integer update(InvoiceExpressSubDataEntity entity) throws XbbException;

    @Override
    List<InvoiceExpressSubDataEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer insertBatch(List<InvoiceExpressSubDataEntity> entities) throws XbbException;

    List<InvoiceExpressSubDataEntity> getByDataId(Long dataId, String corpid);

    Integer deleteBatch(String corpid, List<InvoiceExpressSubDataEntity> entities, WriteRequest.RefreshPolicy refreshPolicy) throws XbbException;

    Integer updateBatch(List<UpdateDataEntity> updateList, String corpid) throws XbbException;

    Integer deleteByDataId(Long dataId, String corpid) throws XbbException;

    Integer deleteBatchByDataId(List<Long> dataIds, String corpid, DelEnum delEnum) throws XbbException;

    List<InvoiceExpressSubDataEntity> getByDataIds(List<Long> dataIds, String corpid, DelEnum delEnum);

    void restoreBatch(List<Long> dataIds, String corpid) throws XbbException;

    /**
     * 更新del
     * @param updateDelList
     * @param corpid
     * @param refreshPolicy
     * @param delEnum
     * @return
     * @throws XbbException
     */
    Integer updateDel(List<InvoiceExpressSubDataEntity> updateDelList, String corpid, WriteRequest.RefreshPolicy refreshPolicy, DelEnum delEnum) throws XbbException;

    Integer updateBatchByEntity(List<? extends PaasFormSubDataEntity> list, String corpid) throws XbbException;
}
